﻿CREATE FUNCTION [dbo].[Collection_PaymentStats](
	@LoanID int
)RETURNS TABLE 
RETURN 
SELECT DPD30,DPD60,DPD90,DPD120,DPDA
FROM usix.t_CustomerFile_Export CF_E WITH(nolock)
OUTER APPLY PaymentDPDs( CF_E.UsixID,CF_E.CompanyID_Raw)
WHERE CF_E.LoanID = @LoanID



